#pragma once

#include "IpcInfo.h"

class CIpcBuff
{
public:
	CIpcBuff(void)
	{
		memset(&m_IpcHead,0,sizeof(m_IpcHead));
		memset(m_Buff,0,sizeof(char)*IPC_BUFF_LEN);
		m_nBuffUsedLenth  = 0;
	};
	~CIpcBuff(void){};

public:
	  Ipc_Head   m_IpcHead;
	  char		 m_Buff[IPC_BUFF_LEN];
	  int        m_nBuffUsedLenth;

public:
    
	void CopyData(char* pDesBuff, int nLen)
	{
		if (pDesBuff && nLen > 0 && nLen < IPC_BUFF_LEN)
		{
			memcpy(m_Buff,pDesBuff,sizeof(char)*nLen);
			SetBuffUsedLenth(nLen);

		}

	}

	void SetBuffUsedLenth(int nUsedLenth)
	{
		m_nBuffUsedLenth = nUsedLenth ;
	}

	int GetBuffUsedLenth()
	{
		return m_nBuffUsedLenth;
	}
   
	
};

